home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_skitotruck.cog < prev    next >
Text File  |  1999-11-15  |  15KB  |  607 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PYR_SkitoTruck.cog
  4. #
  5. # Commies arrive in Meroe
  6. #
  7. # [PAZ (Skito!)] + [RKD]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. message     startup
  15. message        entered
  16. message        crossed
  17. message        timer
  18.     
  19. # Commies that swoop the scene
  20. thing        truckspot                        #spot for minecar truck
  21. thing        truck                   local        #thing you create, capture, and move, then  destroy
  22. thing        newspot                            #where the new truck thing gets created when the minecar is destroyed
  23.     
  24. thing         team1_1                               #teams of commies
  25. thing        team1_2
  26. thing        t1_1_spot                        #teams' destinations
  27. thing        t1_2_spot
  28.     
  29. thing        team2_1
  30. thing        team2_2
  31. thing        t2_1_spot                            
  32. thing        t2_2_spot
  33.     
  34. thing        team3_1
  35. thing        team3_2
  36. thing        t3_1_spot                            
  37. thing        t3_2_spot
  38.     
  39. thing        team4_1
  40. thing        team4_2
  41. thing        t4_1_spot                            
  42. thing        t4_2_spot
  43.     
  44. # Indy and his cutscene stuff                 
  45. thing        player                local
  46. thing        indy
  47.  
  48. # jeep hiding mechanism
  49. thing        jeep
  50. thing        actorjeep
  51. sector        nojeepsector1
  52. sector        nojeepsector2
  53. sector        nojeepsector3
  54. thing        jeepjump1
  55. thing        jeepjump2
  56. thing        jeepjump3
  57. thing        hint57
  58.         
  59. # trigger 1 and prerequisites
  60. surface        trigger1                        # trigger surface
  61. sector        trigger1a                        # indy must enter lightroom before commies will enter
  62. thing        scene1cam1                           # camera spots for cutscenes
  63. thing        scene1look                        # camera lookthing
  64. thing        aispot1                            # ai marks for cutscenes
  65.     
  66. # trigger 2 and prerequisites
  67. surface        trigger2
  68. surface        trigger2a        mask=0x080        # pushblock has to enter this face before scene will be triggered
  69. thing        scene2cam1
  70. thing        scene2cam2
  71. thing        scene2look2                        # camera lookthing
  72. thing        aispot2
  73. thing        indyport                        # teleport Indy to a good spot for walking
  74.     
  75. # trigger 3
  76. surface        trigger3
  77. thing        scene3cam1
  78. thing        aispot3
  79.  
  80. # trigger 4
  81. surface        trigger4
  82. thing        dunedoor
  83. thing        indylook4
  84. thing        scene4cam1
  85. thing        scene4cam2
  86. thing        scene4look2
  87. thing        aispot4
  88.  
  89. # music
  90. sound        tunes=mus_gen_russbold_shrt2.wav  local  #scary russian tunes...eeek!
  91.  
  92. # saylines
  93. sound        uhoh=Inxj011.wav                local    # Uh-oh
  94. sound        reds=Inxj068.wav                local    # Reds, they're everywhere
  95. sound        truckwav=jep_reverse_loop.wav    local    # Commie truck
  96.     
  97. # templates
  98. template    minetruck=commietruck        local #topless minecar truck w/two commies
  99. template    newtruck=staticflatbed        local #topless static truck thing
  100.     
  101. # variables
  102. int        locked=0        local
  103. int        ready1=0        local
  104. int        ready2=0        local
  105. int        cam1=0            local    # represents current camera ghost
  106. flex    cursound=0.0    local
  107.  
  108. # subroutines
  109. flex    scene1=0.0        local
  110. flex    scene2=0.0        local
  111. flex    scene3=0.0        local
  112. flex    scene4=0.0        local
  113. flex    stopscene=0.0    local
  114. flex    startscene=0.0    local
  115. flex    commies=0.0        local
  116. flex    movetruck=0.0    local
  117. flex    afterscene=0.0    local
  118. end
  119.  
  120. #========================================================================================
  121.  
  122. code
  123. startup:
  124.     sleep(.01);
  125.  
  126.     # hide all commies
  127.     SetThingFlags(team1_1, 0x80000);
  128.     SetThingFlags(team1_2, 0x80000);
  129.     SetThingFlags(team2_1, 0x80000);
  130.     SetThingFlags(team2_2, 0x80000);
  131.     SetThingFlags(team3_1, 0x80000);
  132.     SetThingFlags(team3_2, 0x80000);
  133.     SetThingFlags(team4_1, 0x80000);
  134.     SetThingFlags(team4_2, 0x80000);
  135.  
  136.     return;
  137.     
  138. entered:
  139. # ---> trigger prerequisites
  140.  
  141.     player = GetLocalPlayerThing();
  142.     
  143.     if (locked) return;
  144.  
  145.     # if player has gotten into pyr1 lightroom, exiting 1 will trigger commies
  146.     if (GetSenderRef() == trigger1a)
  147.     {
  148.         ready1 = 1;
  149.     }
  150.     
  151.        # if block is pushed out, next exit will trigger commies
  152.     if (GetSenderRef() == trigger2a)
  153.     {
  154.         # prepare for future exit
  155.         ready2 = 1;
  156.  
  157.         # if kid is already gone, start cutscene now instead
  158.         if (global3 == 3)
  159.         {
  160.             call scene2;
  161.         }
  162.     }
  163.     
  164.     return;
  165.     
  166. crossed:
  167. # ---> trigger adjoins
  168.     
  169.     # if kid is still around or scene already ran, return
  170.     if (global3 != 3) return;
  171.     if (locked) return;
  172.  
  173.     player = GetLocalPlayerThing();
  174.     
  175.     # leaving front top of pyramid 1
  176.     if ((GetSenderRef() == trigger1) && (ready1))
  177.     {
  178.         # prepare player
  179.         if (MakeMeStop() == -1) return;
  180.         DeselectWeaponWait(player);
  181.         
  182.         # play commie sound
  183.         call scene1;
  184.     }
  185.  
  186.     # leaving front of pyramid 2
  187.     if ((GetSenderRef() == trigger2) && (ready2))
  188.     {
  189.         # prepare player
  190.         if (MakeMeStop() == -1) return;
  191.         DeselectWeaponWait(player);
  192.         
  193.         # play commie sound
  194.         cursound = PlaySoundThing(truckwav, scene2cam2, .1, 1, 50, 1);
  195.         ChangeSoundVol(cursound, 1, 2);
  196.         sleep(1);
  197.         call scene2;
  198.     }
  199.     
  200.     # leaving hole behind pyramid 3
  201.     if (GetSenderRef() == trigger3)
  202.     {
  203.         # prepare player
  204.         if (MakeMeStop() == -1) return;
  205.         DeselectWeaponWait(player);
  206.         
  207.         call scene3;
  208.     }    
  209.     
  210.     # leaving desert trap door (if it's open);
  211.     if ((GetSenderRef() == trigger4) && (GetCurFrame(dunedoor) == 1))
  212.     {
  213.         # prepare player
  214.         if (MakeMeStop() == -1) return;
  215.         DeselectWeaponWait(player);
  216.         
  217.         # play commie sound
  218.         cursound = PlaySoundThing(truckwav, indylook4, .1, 1, 50, 1);
  219.         ChangeSoundVol(cursound, 1, 2);
  220.         sleep(1);
  221.         
  222.         call scene4;
  223.     }    
  224.     
  225.     return;
  226.  
  227. startscene:
  228.     # Prep for cutscene...
  229.     StartCutscene(1);
  230.     
  231.     # stop all future cutscenes
  232.     locked = 1;
  233.  
  234.     # Switch actor indy for player...
  235.     CopyPlayerHolsters(player, indy);
  236.     TeleportThing(indy, player);
  237.     SetThingFlags(player, 0x80000); # hide him
  238.     
  239.     ClearThingFlags(indy, 0x80000); # reveal our actor
  240.     
  241.     Sleep(0.01);
  242.     
  243.     # Bring commies out of hiding
  244.     ClearThingFlags(team1_1, 0x80000);
  245.     AISetCutsceneMode(team1_1);
  246.     ClearThingFlags(team1_2, 0x80000);
  247.     AISetCutsceneMode(team1_2);
  248.     ClearThingFlags(team2_1, 0x80000);
  249.     AISetCutsceneMode(team2_1);
  250.     ClearThingFlags(team2_2, 0x80000);
  251.     AISetCutsceneMode(team2_2);
  252.     ClearThingFlags(team3_1, 0x80000);
  253.     AISetCutsceneMode(team3_1);
  254.     ClearThingFlags(team3_2, 0x80000);
  255.     AISetCutsceneMode(team3_2);
  256.     ClearThingFlags(team4_1, 0x80000);
  257.     AISetCutsceneMode(team4_1);
  258.     ClearThingFlags(team4_2, 0x80000);
  259.     AISetCutsceneMode(team4_2);
  260.     
  261.     # Prep camera & cut...
  262.     SetCameraLookInterp(2, 0); # kill pan & tilt to lock on 2nd target
  263.     SetCameraPosInterp(2, 0); # kill dolly mode too
  264.     SetCameraFocus(2, cam1);
  265.     SetCameraSecondaryFocus(2, indy);
  266.     SetCurrentCamera(2);
  267.     Sleep(0.01);
  268.     
  269.     # move indy's jeep if it's in perilous sector 1
  270.     if (GetThingSector(jeep) == nojeepsector1)
  271.     {
  272.         TeleportThing(jeep, jeepjump1);
  273.         TeleportThing(actorjeep, jeepjump1);
  274.         TeleportThing(hint57, actorjeep);
  275.         AttachThingToThing(hint57, actorjeep);
  276.     }
  277.  
  278.        # move indy's jeep if it's in perilous sector 2
  279.     if (GetThingSector(jeep) == nojeepsector2)
  280.     {
  281.         TeleportThing(jeep, jeepjump2);
  282.         TeleportThing(actorjeep, jeepjump2);
  283.         TeleportThing(hint57, actorjeep);
  284.         AttachThingToThing(hint57, actorjeep);
  285.     }
  286.  
  287.        # move indy's jeep if it's in perilous sector 3
  288.     if (GetThingSector(jeep) == nojeepsector3)
  289.     {
  290.         TeleportThing(jeep, jeepjump3);
  291.         TeleportThing(actorjeep, jeepjump3);
  292.         TeleportThing(hint57, actorjeep);
  293.         AttachThingToThing(hint57, actorjeep);
  294.     }
  295.  
  296.     return;
  297.     
  298. #========================================================================================
  299.  
  300. stopscene:
  301.     # Set up cam1 to interp back to player
  302.     TeleportThing(player, indy);
  303.     Sleep(0.01);
  304.     SetCameraFOV(90, 0, 0.0);
  305.     SetCameraPosition(1, GetThingPOS(cam1));
  306.     Sleep(0.01);
  307.     SetCurrentCamera(1);
  308.     
  309.     # Return player to game...
  310.     SetThingFlags(indy, 0x80000); # hide actor
  311.     ClearThingFlags(player, 0x80000); # player visible
  312.     ClearThingFlags(jeep, 0x80000); # his jeep is too
  313.     ClearActorFlags(player, 0x200000); # player in control
  314.     SetCameraFOV(90, 0, 0.0);
  315.     Sleep(0.01);
  316.  
  317.     AIClearCutsceneMode(team1_1);
  318.     AIClearCutsceneMode(team1_2);
  319.     AIClearCutsceneMode(team2_1);
  320.     AIClearCutsceneMode(team2_2);
  321.     AIClearCutsceneMode(team3_1);
  322.     AIClearCutsceneMode(team3_2);
  323.     AIClearCutsceneMode(team4_1);
  324.     AIClearCutsceneMode(team4_2);
  325.  
  326.     AISetInstinctWpntMode(team1_1);
  327.     AISetInstinctWpntMode(team1_2);
  328.     AISetInstinctWpntMode(team2_1);
  329.     AISetInstinctWpntMode(team2_2);
  330.     AISetInstinctWpntMode(team3_1);
  331.     AISetInstinctWpntMode(team3_2);
  332.     AISetInstinctWpntMode(team4_1);
  333.     AISetInstinctWpntMode(team4_2);
  334.     
  335.     # Delay before enabling roam, so that commies arrive at
  336.     # their destinations
  337.     SetTimer(30.0);
  338.  
  339.     EndCutScene();
  340.     
  341.     return;
  342.     
  343.  
  344. #========================================================================================
  345. timer:
  346.     AIEnableInstinct(team1_1, "roam", 1);
  347.     AIEnableInstinct(team1_2, "roam", 1);
  348.     AIEnableInstinct(team2_1, "roam", 1);
  349.     AIEnableInstinct(team2_2, "roam", 1);
  350.     AIEnableInstinct(team3_1, "roam", 1);
  351.     AIEnableInstinct(team3_2, "roam", 1);
  352.     AIEnableInstinct(team4_1, "roam", 1);
  353.     AIEnableInstinct(team4_2, "roam", 1);
  354.     
  355.     return;
  356.  
  357. #========================================================================================
  358.  
  359. movetruck:
  360.     # create, capture, move: Minecar truck
  361.     truck=CreateThing(minetruck, truckspot);
  362.     CaptureThing(truck);
  363.     Sleep(0.01);
  364.     SetThingThrust(truck, '0.0 2.0 0.0');
  365.     return;
  366.     
  367. #========================================================================================
  368.  
  369. commies:
  370.  
  371.     # Bring commies out of hiding
  372.     ClearThingFlags(team1_1, 0x80000);
  373.     AISetCutsceneMode(team1_1);
  374.     ClearThingFlags(team1_2, 0x80000);
  375.     AISetCutsceneMode(team1_2);
  376.     ClearThingFlags(team2_1, 0x80000);
  377.     AISetCutsceneMode(team2_1);
  378.     ClearThingFlags(team2_2, 0x80000);
  379.     AISetCutsceneMode(team2_2);
  380.     ClearThingFlags(team3_1, 0x80000);
  381.     AISetCutsceneMode(team3_1);
  382.     ClearThingFlags(team3_2, 0x80000);
  383.     AISetCutsceneMode(team3_2);
  384.     ClearThingFlags(team4_1, 0x80000);
  385.     AISetCutsceneMode(team4_1);
  386.     ClearThingFlags(team4_2, 0x80000);
  387.     AISetCutsceneMode(team4_2);
  388.     
  389.     #team 1:
  390.     AiSetLookThing(team1_1, t1_1_spot);
  391.     AiSetMoveThing(team1_1, t1_1_spot, 0);
  392.     AiSetLookThing(team1_2, t1_2_spot);
  393.     AiSetMoveThing(team1_2, t1_2_spot, 0);
  394.     
  395.     #team 2:
  396.     AiSetLookThing(team2_1, t2_1_spot);
  397.     AiSetMoveThing(team2_1, t2_1_spot, 0);
  398.     AiSetLookThing(team2_2, t2_2_spot);
  399.     AiSetMoveThing(team2_2, t2_2_spot, 0);
  400.     
  401.     #team 3:
  402.     AiSetLookThing(team3_1, t3_1_spot);
  403.     AiSetMoveThing(team3_1, t3_1_spot, 0);
  404.     AiSetLookThing(team3_2, t3_2_spot);
  405.     AiSetMoveThing(team3_2, t3_2_spot, 0);
  406.     
  407.     #team 4:
  408.     AiSetMoveSpeed(team4_1, 2.0);
  409.     AiSetMoveSpeed(Team4_2, 2.0);
  410.     AiSetLookThing(team4_1, t4_1_spot);
  411.     AiSetMoveThing(team4_1, t4_1_spot, 0);
  412.     AiSetLookThing(team4_2, t4_2_spot);
  413.     AiSetMoveThing(team4_2, t4_2_spot, 0);
  414.  
  415.     return;
  416.  
  417. #========================================================================================
  418.  
  419. afterscene:
  420.     #wait 'til truck stops moving, destroy, create new truck, commies
  421.     AiWaitForStop(truck);
  422.     DestroyThing(truck);
  423.     Sleep(0.01);
  424.     CreateThing(newtruck, newspot);
  425.     
  426.     return;
  427.  
  428. #========================================================================================
  429.  
  430. scene1:
  431.     cursound = PlaySoundThing(truckwav, scene1cam1, .5, 10, 50, 1);
  432.     
  433.     # reassign cam1
  434.     cam1 = scene1cam1;
  435.     Sleep(0.01);
  436.     
  437.     call startscene;
  438.     
  439.     # SetCamera 2's FOV
  440.     SetCameraFOV(50, 0, 0.0);
  441.     
  442.     # move indy out to scope the scene
  443.     sleep(.5);
  444.     AiSetLookThing(indy, aispot1);
  445.     PlayVoice(indy, uhoh, 1, 0);
  446.     AiSetMoveThing(indy, aispot1, 1);
  447.     AiSetLookThing(indy, newspot);
  448.     Sleep(0.5);
  449.     
  450.     # kick out the jams
  451.     PlaySoundLocal(tunes, 1.0, 0, 0x0000, 0);
  452.     ChangeSoundVol(cursound, 0, 4);       
  453.  
  454.     # call in the troops
  455.     call commies;
  456.     call movetruck;
  457.     
  458.     # camera cuts over to look at commies
  459.     SetCameraLookInterp(2, 0);
  460.     SetCameraSecondaryFocus(2, scene1look);
  461.     SetCameraFOV(90, 1, 10.0);
  462.     sleep(2);
  463.     MoveToFrame(scene1look, 1, 4);
  464.     sleep(4);
  465.     PlayVoice(indy, reds, 1, 0);
  466.     Sleep(3.5);
  467.     
  468.     call stopscene;
  469.     call afterscene;
  470.     
  471.     return;
  472.     
  473. #========================================================================================
  474.  
  475. scene2:
  476.     cursound = PlaySoundThing(truckwav, scene2cam2, .1, 1, 50, 1);
  477.     ChangeSoundVol(cursound, .3, 2);
  478.     sleep(1);
  479.     
  480.     # reassigne cam1
  481.     cam1 = scene2cam1;
  482.     Sleep(0.01);
  483.     
  484.     call startscene;
  485.     
  486.     TeleportThing(indy, indyport);
  487.  
  488.     # SetCamera 2's FOV
  489.     SetCameraFOV(100, 0, 0.0);
  490.            
  491.     # move indy out to scope the scene
  492.     AiSetLookThing(indy, aispot2);
  493.     PlayVoice(indy, uhoh, 1, 0);
  494.     AiSetMoveThing(indy, aispot2, 1);
  495.     AiSetLookThing(indy, newspot);
  496.     Sleep(0.5);
  497.     
  498.     # kick out the jams
  499.     PlaySoundLocal(tunes, 1.0, 0, 0x0000, 0);
  500.     ChangeSoundVol(cursound, 0, 6);       
  501.     
  502.     # call in the troops
  503.     call commies;
  504.     call movetruck;
  505.     
  506.     # camera cuts over to look at commies
  507.     SetCameraLookInterp(2, 1);
  508.     SetCameraPosInterp(2, 1);
  509.     SetCameraSecondaryFocus(2, scene2look2);
  510.     SetCameraInterpSpeed(2, 5.8);
  511.     SetCameraFOV(75, 1, 5.8);
  512.     SetCameraFocus(2, scene2cam2);
  513.     sleep(4.0);
  514.     PlayVoice(indy, reds, 1, 0);
  515.     Sleep(4.0);
  516.     
  517.     call stopscene;
  518.     call afterscene;
  519.     
  520.     return;
  521.  
  522. #========================================================================================
  523.  
  524. scene3:
  525.  
  526.     # reassign cam1
  527.     cam1 = scene3cam1;
  528.     Sleep(0.01);
  529.     
  530.     call startscene;
  531.     
  532.     # SetCamera 2's FOV
  533.     SetCameraFOV(70, 0, 0.0);
  534.            
  535.     # move indy out to scope the scene
  536.     AiSetLookThing(indy, aispot3);
  537.     PlayVoice(indy, uhoh, 1, 0);
  538.     AiSetMoveThing(indy, aispot3, 1);
  539.     AiSetLookThing(indy, team1_1);
  540.     Sleep(0.5);
  541.     
  542.     # call in the troops
  543.     call commies;
  544.     call movetruck;
  545.     
  546.     # kick out the jams
  547.     PlaySoundLocal(tunes, 1.0, 0, 0x0000, 0);
  548.     
  549.     # camera cuts over to look at commies
  550.     SetCameraLookInterp(2, 0);
  551.     SetCameraSecondaryFocus(2, truck);
  552.     MoveToFrame(scene3cam1, 1, 1);
  553.     Sleep(4);
  554.     PlayVoice(indy, reds, 1, 0);
  555.     Sleep(5);
  556.     
  557.     call stopscene;
  558.     call afterscene;
  559.     
  560.     return;
  561.     
  562. #========================================================================================
  563.  
  564. scene4:
  565.     # reassign cam1
  566.     cam1 = scene4cam1;
  567.     Sleep(0.01);
  568.     
  569.     call startscene;
  570.     
  571.     # SetCamera 2's FOV
  572.     SetCameraFOV(100, 0, 0.0);
  573.            
  574.     # move indy out to scope the scene
  575.     AiSetLookThing(indy, indylook4);
  576.     PlayVoice(indy, uhoh, 1, 0);
  577.     AiSetMoveThing(indy, aispot4, 1);
  578.     AIWaitForStop(indy);
  579.     Sleep(1);
  580.     
  581.     # call in the troops
  582.     call commies;
  583.     call movetruck;
  584.     
  585.     # kick out the jams
  586.     PlaySoundLocal(tunes, 1.0, 0, 0x0000, 0);
  587.     ChangeSoundVol(cursound, 0, 6);       
  588.     
  589.     # camera cuts over to look at commies
  590.     SetCameraFOV(70, 0, 1);
  591.     SetCameraFocus(2, scene4cam2);
  592.     SetCameraLookInterp(2, 0);
  593.     SetCameraSecondaryFocus(2, scene4look2);
  594.     SetCameraFOV(110, 1, 8);
  595.     Sleep(4);
  596.     PlayVoice(indy, reds, 1, 0);
  597.     Sleep(5);
  598.     
  599.     call stopscene;
  600.     call afterscene;
  601.     
  602.     return;
  603.  
  604. end
  605.     
  606.  
  607.